﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site/Master/Main.Master" AutoEventWireup="true"
    CodeBehind="ProductDetail.aspx.cs" Inherits="ECommerce.Web.Site.ProductDetail" %>
        <%@ Register src="controls/SaleRank.ascx" tagname="SaleRank" tagprefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="styles/Threepage.css" rel="stylesheet" type="text/css" />
    <link href="styles/Pager.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.jqzoom-core.js" type="text/javascript"></script>
    <link href="styles/jquery.jqzoom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function ()
        {
            $('.jqzoom').jqzoom({
                zoomType: 'standard',
                lens: true,
                preloadImages: false,
                alwaysOn: false,
                title: false,
                zoomWidth: 450,
                zoomHeight:550
            });

        });

        function func1(id)
        {
//            document.getElementById("img01").src = img1;
//            document.getElementById("a01").href = img2;
            $(".jqzoom").css("display", "none");
            $("#a" + id).css("display", "");
        }

        function tab_click(index)
        {
            for (var i = 1; i < 4; i++)
            {
                $("#tab" + i).removeClass("sy");
                $("#div" + i).css("display", "none");
            }
            $("#tab" + index).addClass("sy");
            $("#div" + index).css("display", "");


        }

        function validate()
        {
            var value = $("#<%=txtCount.ClientID %>").val();

           
            if (isNaN(value))
            {
                alert("购买数量格式不对");
                return false;
            }
            else
            {
                if (value < 1 || value > 99)
                {
                    alert("购买数量应在1到99之间");
                    return false;
                }
            }

            return true;
        }

        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="main">
        <div class="currentpage">
            <a href="javascript://">首页 </a>&gt;<a href="javascript://"><asp:Literal ID="litMake"
                runat="server"></asp:Literal> </a>&gt;<a href="javascript://">
                    <asp:Literal ID="litProductName" runat="server"></asp:Literal></a></div>
        <div class="picshow">
            <div class="left">                
                <div >
                    <asp:Repeater ID="rptBigImage" runat="server">
                        <ItemTemplate>
                            <a id="a<%#Eval("ID") %>" href="<%#Eval("OriginImageAbsPath") %>" class="jqzoom" style="display:none">
                                <img id="img01" class="pic" src="<%#Eval("BigImageAbsPath") %>" style="width:442px; height:442px;" alt=""/>
                            </a>
                        </ItemTemplate>
                    </asp:Repeater>    
                    <script type="text/javascript">
                        if ($(".jqzoom").length > 0)
                        {
                            $($(".jqzoom").get(0)).css("display", "");
                        }
                    </script>                
                    <div class="right" style=" height:540px; top:0px;right:0px; position:absolute;">
                        <p class="weight">
                            <a href="javascript://" class="weight">[<asp:Literal ID="litType1Name" runat="server"></asp:Literal>]</a><asp:Literal
                                ID="Name" runat="server"></asp:Literal></p>
                        <h1>
                            <asp:Literal ID="Remark" runat="server"></asp:Literal></h1>
                       
                        <h2>
                            商品编号：<asp:Literal ID="litID" runat="server"></asp:Literal></h2>
                        <div class="prize">
                            <h3>
                                原价：<span><asp:Literal ID="OldPrice" runat="server"></asp:Literal></span></h3>
                            <h3>
                                现价：<em><asp:Literal ID="CurrentPrice" runat="server"></asp:Literal></em></h3>
                            <h3>
                                评价：                               
                                <asp:Literal ID="litCommentImg" runat="server"></asp:Literal>
                                <asp:Literal ID="litCommentCount" runat="server"></asp:Literal></h3>
                        </div>
                        <h2>
                            材料：<asp:Literal ID="Material" runat="server"></asp:Literal>
                        </h2>
                        <h2>
                            包装：<asp:Literal ID="Packag" runat="server"></asp:Literal></h2>
                        <div class="details">
                            <h3 style="display:none">
                                请选择尺寸:<asp:DropDownList ID="drpSize" runat="server">
                                </asp:DropDownList>
                            </h3>
                            <!--<h3>
                                请选择餐具：<select><option>3人份餐具</option>
                                </select></h3>-->
                            <h3>
                                购买数量：<asp:TextBox ID="txtCount" runat="server" Text="1"></asp:TextBox>
                                </h3>
                            <!--<h3>
                                已选择：<em>八寸(适合2－3人食用) 3人份餐具</em></h3>-->
                            <h3>
                                <asp:LinkButton ID="btnBuy" runat="server" onclick="btnBuy_Click" OnClientClick="return validate()">立即购买</asp:LinkButton>
                                <asp:HyperLink ID="lnkFavorite" runat="server">加入收藏</asp:HyperLink>
                                
                              </h3>
                        </div>
                    </div>
                 </div>
                 <div style="clear:both;"></div>
                <div class="paging">
                    <a href="javascript://" class="front">
                        <img src="images/thpic-03.jpg" /></a>
                    <asp:Repeater ID="rpt" runat="server">
                        <ItemTemplate>
                            <a href="javascript:func1('<%#Eval("ID") %>');"
                                class="picture">
                                <img src='<%#Eval("SmallImageAbsPath") %>' /></a>
                        </ItemTemplate>
                    </asp:Repeater>
                     <a href="javascript://" class="next">
                                            <img src="images/thpic-04.jpg" /></a>
                </div>
            </div>
           <!-- <div class="right">
                <div class="pic">
                    <img src="images/thpic.jpg" /></div>
            </div>-->
            <div class="clear">
            </div>
        </div>
        <div class="recommend">
           <uc2:SaleRank ID="SaleRank1" runat="server" />
            <div class="hotassess">
                <div class="explain">
                    <div class="explaintit">
                        <div class="exp_list">
                            <a href="javascript:tab_click(1)" id="tab1" class="sy">商品介绍</a>
                           <!-- <a id="tab2"  href="javascript:tab_click(2)">包装清单</a> 
                            <a id="tab3"  href="javascript:tab_click(3)">售后服务</a>-->
                        </div>
                    </div>
                    <asp:Panel ID="pnlMain" CssClass="explaincon" runat="server">                    
                   
                        <div id="div1">
                            <p>
                                [材 料]：<asp:Literal ID="Material2" runat="server"></asp:Literal></p>
                            <p>
                                [包 装]：<asp:Literal ID="Packag2" runat="server"></asp:Literal></p>
                            <p>
                                [花 语]：<asp:Literal ID="FlowerWord" runat="server"></asp:Literal></p>
                            <p>
                                [配送范围]：<asp:Literal ID="SendRange" runat="server"></asp:Literal></p>
                            <p>
                                [订花热线]：400-658-3377，400-069-8996</p>
                            <p>
                                [说 明]：<asp:Literal ID="Remark2" runat="server"></asp:Literal></p>
                        </div>
                       <div id="div2"><p><asp:Literal ID="Packag3" runat="server"></asp:Literal></p></div>
                       <div id="div3"></div>
                        <div class="picture">
                            <asp:Image ID="imgAD" runat="server" />
                        </div>
                        <div class="allexp">
                            <p class="weight">
                                全部评论(<asp:Literal ID="lblCommentCount" runat="server"></asp:Literal>条)</p>
                            <asp:Repeater ID="rptComment" runat="server">
                                <ItemTemplate>
                                    <div class="allexp_list">
                                <div class="attit">
                                    <span class="left">&nbsp;&nbsp;总评：<%#GetScore(Eval("Score"))%></span><span class="right"><%#Eval("InputTime") %></span></div>
                                <div class="atcon">
                                    <div class="atcona">
                                        <div class="left">
                                            <img src="images/thpic-08.jpg" /><%#Eval("MemberLoginName") %>
                                        </div>
                                        <div class="right">
                                            <h1>
                                                <span>价格：</span> <%#Eval("Price") %></h1>
                                            <h1>
                                                <span>口味：</span><%#Eval("Taste") %></h1>
                                            <h1>
                                                <span>造型：</span><%#Eval("Sculpt")%></h1>
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                    <h2>
                                        <%#Eval("Content") %></h2>
                                </div>
                            </div>
                                </ItemTemplate>
                            </asp:Repeater>                        
                           
                           
                        </div>
                        <asp:Literal ID="litPager" runat="server"></asp:Literal>                 
                    </asp:Panel>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
